<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\web\NotFoundHttpException;

//chỉ admin mới có quyền
if(Yii::$app->user->isGuest || Yii::$app->user->identity->acc_type!=0)
{
	throw new NotFoundHttpException('The requested page does not exist.');
}
else
{

	/* @var $this yii\web\View */
	/* @var $searchModel app\models\WorkAccountSearch */
	/* @var $dataProvider yii\data\ActiveDataProvider */

	$this->title = 'Các tài khoản làm việc';
	//$this->params['breadcrumbs'][] = $this->title;
	?>
	<div class="work-account-index">

		<h1><?= Html::encode($this->title) ?></h1>
		<?php // echo $this->render('_search', ['model' => $searchModel]); ?>

		<p>
			<?= Html::a('Thêm tài khoản làm việc mới', ['create'], ['class' => 'btn btn-success']) ?>
		</p>

		<?= GridView::widget([
			'dataProvider' => $dataProvider,
			'filterModel' => $searchModel,
			'columns' => [
				['class' => 'yii\grid\SerialColumn'],

				//'id',
				'work_acc',
				'work_pass',
				//'ban',
				// 'acc_pro_id',
				'accPro.user.full_name',
				'accPro.project.name',

				['class' => 'yii\grid\ActionColumn',
					'template' => '{update} {delete}',],
				
			],
		]); ?>

	</div>

<?php
}
?>